
PATH=L:\Product\UnxUtils\usr\local\wbin;L:\Product\swigwin-2.0.0;%PATH%
rm -rf openfixfast
mkdir openfixfast

echo 'Running swig...'
swig -csharp -c++  -I"." -I"../cpp/" -outdir openfixfast -namespace openfixfast openfixfast.i

echo 'Generic bugs'
mv openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/openfixfast::c_vpfWrapper//g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx

echo 'Linking  warning for Connect_wrap.cxx '
echo #pragma warning (disable : 4786) > openfixfast_wrap.cxx000
type openfixfast_wrap.cxx >> openfixfast_wrap.cxx000
mv -f openfixfast_wrap.cxx000 openfixfast_wrap.cxx 

echo 'Linking  warning for Connect_wrap.h '
echo #pragma warning (disable : 4786) > openfixfast_wrap.h000
type openfixfast_wrap.h >> openfixfast_wrap.h000
mv -f openfixfast_wrap.h000 openfixfast_wrap.h



echo '  Fixing CHAR'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/CHAR \*arg1/char \*arg1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CHAR'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(CHAR const/(char const/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CHAR'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/CHAR temp1/char temp1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CHAR'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(CHAR)/(char)/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000


echo '  Fixing INT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/INT \*arg1/int \*arg1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing INT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(INT const/(int const/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing INT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/INT temp1/int temp1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing INT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(INT)/(int)/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000


echo '  Fixing FLOAT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/FLOAT \*arg1/double \*arg1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing FLOAT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(FLOAT const/(double const/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing FLOAT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/FLOAT temp1/double temp1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing FLOAT'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(FLOAT)/(double)/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000


echo '  Fixing BOOLEAN'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/BOOLEAN \*arg1/bool \*arg1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing BOOLEAN'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(BOOLEAN const/(bool const/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing BOOLEAN'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/BOOLEAN temp1/bool temp1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing BOOLEAN'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(BOOLEAN)/(bool)/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CURRENCY'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/CURRENCY \*arg1/std::string \*arg1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CURRENCY'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(CURRENCY const/(std::string const/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CURRENCY'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/CURRENCY temp1/std::string temp1/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000

echo '  Fixing CURRENCY'
mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000
sed "s/(CURRENCY)/(std::string)/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
rm openfixfast_wrap.cxx000


REM echo '  Fix new series bugs'
REM mv -f openfixfast_wrap.cxx openfixfast_wrap.cxx000

REM sed "s/SWIGEXPORT void SWIGSTDCALL CSharp_delete_series_t(void \* jarg1)/\\nSWIGEXPORT void \* SWIGSTDCALL CSharp_new_series_t() \\n{ \\n\\tvoid \* jresult ; \\n\\tseries_t \*result = 0 ; \\n\\tresult = (series_t \*)new series_t(); \\n\\tjresult = (void \*)result; \\n\\treturn jresult; \\n} \\nSWIGEXPORT void SWIGSTDCALL CSharp_delete_series_t(void \* jarg1)/g" openfixfast_wrap.cxx000 > openfixfast_wrap.cxx
REM rm openfixfast_wrap.cxx000



echo '  Fix warning 4786, 401'
echo #include "stdafx.h" > openfixfast_wrap.cxx000
echo #include "Application.h" >> openfixfast_wrap.cxx000
echo #include "MessageCracker.h" >> openfixfast_wrap.cxx000
echo #include "Values.h" >> openfixfast_wrap.cxx000
echo #include "Mutex.h" >> openfixfast_wrap.cxx000
echo #pragma warning (disable : 4786) >> openfixfast_wrap.cxx000
echo #pragma warning (disable : 401) >> openfixfast_wrap.cxx000
cat  openfixfast_wrap.cxx >> openfixfast_wrap.cxx000
mv -f openfixfast_wrap.cxx000 openfixfast_wrap.cxx

